var {
  clickUtils,
  gUtils,
  logUtils,
  ocrUtils,
  appUtils,
} = require("../../utils/index");
var { App } = require("../base/index");
var pointMap = require("./pointMap/index");

var hongGuoMF = new App("红果免费短剧", {
  maxCount: 30,
  interval: 10 * 60,
  autoClose: true,
});

hongGuoMF.run = function (count) {
  gUtils.sleep(15, 20);
  var OcrText = ocrUtils.captureExistsOneText(["选集"]);
  if (!OcrText) {
    var index = gUtils.random(1, 9);
    logUtils.log("将点击首页第" + index + "类视频");
    clickUtils.clickPointMap(pointMap.首页[index]);
    gUtils.sleep(2, 3);
  }
  this.watchVideo(count);
};
hongGuoMF.watchVideo = function (count) {
  logUtils.log("第" + count + "红果免费短剧");
  for (var index = 0; index < 5; index++) {
    logUtils.log("第" + (index + 1) + "次看视频");
    gUtils.sleep(60, 90);
    if (gUtils.possible(1, 10)) {
      appUtils.home(this.appName);
    }
  }
};
module.exports = hongGuoMF;
